from django.db import models
from django.utils import timezone
# Create your models here.
class Data_date(models.Model):
    date = models.DateField(default=timezone.now, unique=True)
    class Meta:
        db_table = 'data_date'
        ordering = ['date']

class Access_ip(models.Model):
    ip_address =models.GenericIPAddressField()
    date = models.ForeignKey(Data_date, on_delete=models.CASCADE)
    exact_time = models.DateTimeField(auto_now_add=True)
    class Meta:
        db_table = 'access_ip'
        ordering = ['ip_address']